package com.logistics.common;

/**
 * 站点上下文持有者
 * 使用 ThreadLocal 存储当前请求的站点ID
 */
public class SiteContextHolder {
    
    private static final ThreadLocal<Long> SITE_ID = new ThreadLocal<>();
    
    /**
     * 设置站点ID
     */
    public static void setSiteId(Long siteId) {
        SITE_ID.set(siteId);
    }
    
    /**
     * 获取站点ID
     */
    public static Long getSiteId() {
        return SITE_ID.get();
    }
    
    /**
     * 清除站点ID
     */
    public static void clear() {
        SITE_ID.remove();
    }
}

